import axios from 'axios'
import App from './App'
import router from './router'
import store from './store'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import Vue from 'vue'
import utils from './util/utils.js'
import VueI18n from 'vue-i18n'
import storage from './redis/storage'

Vue.use(VueI18n)
Vue.use(Element)
if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.prototype.utils=utils
Vue.http = Vue.prototype.$http = axios
Vue.config.productionTip = false

const i18n = new VueI18n({
  locale: storage.getLang()===undefined?"zh":storage.getLang(),    // 语言标识
  //this.$i18n.locale // 通过切换 locale 的值来实现语言切换
  messages: { // js 方式
    'zh': require('@/i18n/zh'),   // 中文语言包
    'en': require('@/i18n/en')    // 英文语言包
  }
})

/* eslint-disable no-new */
window.$Vue=new Vue({
  components: { App },
  router,
  i18n,
  store,
  template: '<App/>'
}).$mount('#app')
